﻿using ViewMaker.Core.Controls;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using ViewMaker.Core;
using System.Collections.Generic;
using System.Windows.Documents;
using System.Windows.Controls;
using ViewMaker.Core.Tests.Controls;
using System.Windows.Media;
using System.Windows;

namespace ViewMaker.Core.Tests
{
    [TestClass()]
    public class HyperlinkViewControlTest
    {
        [TestMethod()]
        public void 標準的なHyperlinkのXAML生成()
        {
            var target = new HyperlinkViewControl { Item = new ViewLayoutItem { Name = "hl001", Caption = "ハイパー", BindPath = "currentValue" } };
            target.Command = "command";
            var xaml = target.CreateXaml(TestHelper.CreateTestParent())[1];
#if !SILVERLIGHT
            var actual = TestHelper.GetFrameworkElement<Label>(xaml);
            Assert.AreEqual("hl001", ((Hyperlink)actual.Content).Name);
#else
            var actual = TestHelper.GetFrameworkElement<HyperlinkButton>(xaml);
            Assert.AreEqual("hl001", actual.Name);
#endif

        }

        [TestMethod()]
        public void HyperlinkViewControlの編集画面が表示可能()
        {
            var target = new HyperlinkViewControl { Item = new ViewLayoutItem { Name = "hl001", Caption = "ハイパー", BindPath = "currentValue" } };
            target.Command = "command";
            var baml = ViewUtil.BuildContent(target);
            Assert.IsNotNull(baml);
        }


    }
}
